<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>个人中心</title>
</head>
<body style="padding-top: 70px;">
<jsp:include page="/topNav"></jsp:include>
<div class="container">
    <div class="row">
        <div class="col-xs-10">
            <ul id="myTab" class="nav nav-tabs">
                <li>
                    <a href="/Origami/account">
                        账号
                    </a>
                </li>
                <li><a href="/Origami/passwd">密码</a></li>
                <li class="active"><a href="/Origami/info">个人资料</a></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active">

                    <h2>头像</h2>
                    <div role="form" style="width:30%;">
                        <h1></h1>

                        <img src="${user.headimage}"/>
                        <span id="saveimgmsg" style="color: #ff0000"></span>

                        <div class="required-field-block">
                            <input type="file" id="file_upload_1" />
                        </div>
                        <button id="btn-upload" type="button" onclick="javascript:$('#file_upload_1').uploadify('upload')" class
                                ="btn btn-success">上传
                        </button>
                    </div>
                    <table id="imgtable" style="display: none">
                        <tr>
                            <td>
                                <img src="" id="titleImg">

                                <p>

                                <form action="thumbnailHeadImage" method="post">
                                    <input type="hidden" id="x1" name="x1" />
                                    <input type="hidden" id="y1" name="y1" />
                                    <input type="hidden" id="w" name="w" />
                                    <input type="hidden" id="h" name="h" />
                                    <input type="hidden" id="oldpath" name="oldpath" />
                                    <input type="hidden" name="username" value="${username}" />
                                    <button type="button" onclick="thumbnailimage()" class
                                            ="btn btn-success">保存图片
                                    </button>
                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                    <span id="savemsg" style="color: green"></span>
                                </form>
                                </p>
                            </td>
                            <td>
                                <div style="width:96px;height:96px;overflow:hidden;">
                                    <img src="" id="preview96">
                                </div>
                                <p>96x96</p>
                            </td>
                            <td>
                                <div style="width:48px;height:48px;overflow:hidden;">
                                    <img src="" id="preview48">
                                </div>
                                <p>48x48</p>
                            </td>
                        </tr>
                    </table>
                    <div id="successAlert" class="alert alert-success" style="display: none">
                        <a href="#" class="close" data-dismiss="alert">&times;</a>
                        <strong>成功！</strong>修改成功。
                    </div>
                    <div id="failAlert" class="alert alert-warning" style="display: none">
                        <a href="#" class="close" data-dismiss="alert">&times;</a>
                        <strong>警告！</strong>修改失败。
                    </div>
                    <label class="control-label" for="introduce" style="margin-top: 20px;margin-bottom: 5px">个人简
                        介</label>&nbsp;&nbsp;&nbsp;&nbsp;<span
                            id="oldpasswdmsg"
                                                                                                          style="color: #ff0000"></span>

                    <div class="required-field-block" style="width: 30%">
                        <c:choose>
                            <c:when test="${user.profile != null && user.profile != ''}">
                                <textarea rows="3" class="form-control" id="introduce" name="introduce"
                                          maxlength="20"
                                          style="margin-bottom: 15px;margin-top: 5px;height: 100px">${user.profile}</textarea>
                            </c:when>
                            <c:otherwise>
                                <textarea rows="3" class="form-control" id="introduce" name="introduce" placeholder="一句话介绍自己,20字以内"
                                          maxlength="20"
                                          style="margin-bottom: 15px;margin-top: 5px;height: 100px"></textarea>
                            </c:otherwise>
                        </c:choose>

                    </div>

                    <button type="button" onclick="saveprofile()" class
                            ="btn btn-success">保存
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<link href="bootstrap/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="bootstrap/user_defined.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="uploadify/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap/bootstrap.min.js"></script>
<script src="uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="uploadify/uploadify.css">
<link rel="stylesheet" href="jcrop/css/jquery.Jcrop.css">
<script src="jcrop/js/jquery.Jcrop.js"></script>
<script type="text/javascript" src="js/userCenter.js"></script>
</html>